/*  This file is Copyright 2010 Hampton Smith
 *
 *  This file is part of Adventure! a text-adventure game engine by Hampton
 *  Smith.
 *
 *  Adventure! is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  Adventure! is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with Adventure!.  If not, see http://www.gnu.org/licenses/.
 */

package edu.clemson.cs.hamptos.adventure;

import java.util.Set;

/**
 * <p>A strategy for printing out the user's inventory.</p>
 */
class VerbInventory implements VerbStrategy {

    /**
     * <p>By time this is called, we already know that the command is just
     * "inventory".  So we'll print out the player's inventory.</p>
     *
     * @param c The command, but we know what it says.
     * @param e The engine, which we'll leave alone.
     * @param w The window, to which we'll print the inventory.
     */
    public void doCommand(AdventureCommand c, AdventureEngine e,
            AdventureWindow w) {

        Set<AdventureTarget> inventory = e.getPlayerInventory();

        String indent = "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";

        w.println("");
        w.println("<font color='#00FFFF'>" + indent +
                "<b>INVENTORY</b></font>");
        w.println("<font color='#00FFFF'>" + indent + "=========</font><br/>");

        for (AdventureTarget t : inventory) {
            w.println(indent + t.getShortDescription() + " - " +
                    t.getDescription());
        }

        w.println("");
    }

}